import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/testPage'
    },
    {
      path: '/testPage',
      name: 'testPage',
      component: () => import('@/views/Test/index.vue')
    },
    {
      path: '/eluiPage',
      name: 'eluiPage',
      component: () => import('@/views/elUI/index.vue')
    },
    {
      path: '/echartPage',
      redirect: '/echartPage/piechart',
      name: 'echartPage',
      children: [
        {
          path: '/echartPage/piechart',
          component: () => import('@/views/echart/Com_piechart.vue')
        },
        {
          path: '/echartPage/progress',
          component: () => import('@/views/echart/Com_progress/index.vue')
        }
      ],
      component: () => import('@/views/echart/index.vue')
    },
    {
      path: '/mapPage',
      name: 'mapPage',
      redirect: '/mapPage/one',
      children: [
        {
          path: '/mapPage/one',
          component: () => import('@/views/map/demand1/index.vue')
        },
        {
          path: '/mapPage/two',
          component: () => import('@/views/map/demand2/index.vue')
        }
      ]
    },
    {
      path: '/algorithm',
      name: 'algorithm',
      component: () => import('@/views/algorithm/index.vue')
    }
  ]
})

export default router
